#include <ros/protobuffer_traits.h>
#include <ros/serialization_protobuffer.h>

#include "ros/ros.h"

#include "publish_info.pb.h"


void chatterCallback(
    const ros::MessageEvent<pbtest::PublishInfo> &msg) {
  std::cerr << "I heard: " << msg.getMessage()->DebugString() << std::endl;
  std::string def =
      ros::message_traits::Definition<pbtest::PublishInfo>::value();
  std::cout << "def: " << def << std::endl;
}
// %EndTag(CALLBACK)%

int main(int argc, char **argv) {
  ros::init(argc, argv, "pb_listener");
  ros::NodeHandle n;
  ros::Subscriber sub = n.subscribe("/pb_test", 1000, chatterCallback);

  ros::spin();

  return 0;
}
